import request from '@/utils/request'

let dev_url = process.env.VUE_APP_BASE_API
const modUrl = "/sys/dict"
const dictItemUrl = "/sys/dict/item"
export default {
    /* 字典 */
    dictListPage(current, pageSize, query) {
        return request({
            url: `${modUrl}/query/page/${current}/${pageSize}`,
            method: 'get',
            params: query
        })
    },
    addDict(params) {
        return request({
            url: `${modUrl}/add`,
            method: 'post',
            data: params
        })
    },
    updateDict(id, params) {
        return request({
            url: `${modUrl}/update`,
            method: 'put',
        })
    },
    deleteDict(dictId) {
        return request({
            url: `${dev_url}${modeUrl}/delete/${dictId}`,
            method: 'delete',
        })
    },


    /*字典项*/
    dictItemListPage(current, pageSize, query) {
        return request({
            url: `${dictItemUrl}/query/page/${current}/${pageSize}`,
            method: 'get',
            params: query
        })
    },
    addDictItem(params) {
        return request({
            url: `${dictItemUrl}/add`,
            method: 'post',
            data: params
        })
    },
}